<style lang="scss" scoped>
	.content {
		background-color: #ffffff;
		line-height: 0.7rem;
		padding: 0.2rem;
		word-break: break-all;
	}
</style>

<template>
	<div class="container hasNav">
		<van-nav-bar title="急救详情" left-text="返回" left-arrow @click-left="$router.back()" fixed />
		<div class="content" v-html="content"></div>
		<Loading :isShow="loading"></Loading>
	</div>
</template>

<script>
import Loading from '@/components/Loading';
import { getFirstAidDetail } from '../../api/firstaid';

export default {
	name: 'FirstAidDetail',
	components: {
		Loading,
	},
	data() {
		return {
			loading: true,
			content: ''
		}
	},
	mounted() {
		let id = this.$route.query.id;
		this.getFirstAid(id);
	},
	methods: {
		async getFirstAid(id) {
			try {
				this.loading = true;
				const { code, msg, data } = await getFirstAidDetail(id);
				if (code == 200) {
					this.content = data.content;
				} else {
					this.$toast(msg);
				}
				this.$nextTick(() => {
					this.loading = false;
				});
			} catch (error) {
				console.log(error);
				this.loading = false;
			}
		},
	},
};
</script>
